# Pointer aliasing in C ANSI
# Julien Etienne, 2008
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

env = Environment()
env.Append(CCFLAGS='-Wall -Wextra')

DebugEnv=env.Clone()
DebugEnv.Append(CCFLAGS='-g')
DebugObjects = DebugEnv.Object('pointer_aliasing_debug','main.c')
DebugEnv.Program('pointer_aliasing_debug', DebugObjects)

OptimizedEnv=env.Clone()
OptimizedEnv.Append(CCFLAGS='-O3')
OptimizedObjects = OptimizedEnv.Object('pointer_aliasing_optimized','main.c')
OptimizedEnv.Program('pointer_aliasing_optimized', OptimizedObjects)

ControlledOptimizationEnv=env.Clone()
ControlledOptimizationEnv.Append(CCFLAGS='-O3 -fno-strict-aliasing')
ControlledOptimizationObjects = ControlledOptimizationEnv.Object('pointer_aliasing_controlled_optimization','main.c')
ControlledOptimizationEnv.Program('pointer_aliasing_controlled_optimization', ControlledOptimizationObjects)

